<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <title>新闻管理系统</title>
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
	<link rel="stylesheet" href="../../static/css/adminstage.css" th:href="@{/css/adminstage.css}">

      <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js" th:src="@{https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js}"></script>
      <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js" th:src="@{https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js}"></script>

	<link rel="icon" type="image/png" sizes="144x144" href="../../static/images/1.ico" th:href="@{/images/1.ico1}"/>
	<style type="text/css">
		.L_bg1{
			margin-top:50px;
		}
		.L_bg1 img{
			width:100%;
		}
		.bgwhite1{
			background-color:white;
			padding:15px 10px 0px;
			border-radius:10px;
			opacity:0.9;
		}
		.L_bg2{
			margin-top:15px;
		}
		.bgblack3{
			background: #232328;
			padding:10px;
			border-radius:10px;
			opacity:0.9;
		}
		.bgblack3 div h4{
			color:white;
		}
		.title1,.title2{
			color:black;
		}
	</style>
  </head>
  <body>
	<!--插入背景图片-->
	<div class="bg"></div>
	<div class="mask"></div>
	<!--导航-->
    <nav class="navbar navbar-inverse navbar-fixed-top">
	  <div class="container">
		<div class="navbar-header">
		  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
			<span class="sr-only">Toggle navigation</span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
		  </button>
		  <a class="navbar-brand" href="#">新闻管理系统</a>
		</div>

		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
		  <ul class="nav navbar-nav">
			<li class="active"><a href="backstage.html" th:href="@{/admin/-1}">管理员后台</a></li>
			
		  </ul>

			<ul class="nav navbar-nav navbar-right">
				<li class="dropdown">

					<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-user" aria-hidden="true"></span>[[${session.user!=null}?${session.user.nickname}:'游客状态']]<span class="caret" th:if="${session.user!=null}"></span></a>
					<ul class="dropdown-menu dropdown-menu-left" th:if="${session.user!=null}">
						<li><a href="publish.html" th:href="@{/publishs}">发布新闻</a></li>
						<li><a href="backstage.html" th:href="@{/backstage/{userId}(userId=${session.user!=null}?${session.user.id}:'')}">新闻管理</a></li>
						<li role="separator" class="divider"></li>
						<li><a href="#" th:href="@{/logout}">退出登陆</a></li>
					</ul>
				</li>
			</ul>
		</div>
	  </div>
	</nav>	
	
	<!--左边栏-->
	<div class="container L_bg1 bgwhite1 col-md-2 col-md-offset-1">
		<div class="title_line1">
			<span class="title1">管理</span>
		</div>
		
		<!--管理菜单-->
		<div>
			<ul class="nav nav-tabs" role="tablist">
				<li role="presentation" class="active"><a href="#news-manage" aria-controls="news-manage" role="tab" data-toggle="tab">新闻管理</a></li>
				<li role="presentation"><a href="#member-manage" aria-controls="member-manage" role="tab" data-toggle="tab">会员管理</a></li>
			</ul>
		</div>
		
		<div class="title_line1"></div>
	</div>
	
	<!--右边栏-->
	<div class="container L_bg1 bgwhite1 col-md-7 col-md-offset-1">
		<div class="title_line2">
			<span class="title2">信息</span>
		</div>
		<div class="">

		</div>

		<!--信息列表-->
		<div class="tab-content">
			<!--新闻管理-->
			<div role="tabpanel" class="tab-pane active" id="news-manage">
				<ul class="list-group">
				  <li class="list-group-item" th:each="news : ${pages.list}">
					<div>
						<span th:text="${news.type.name}">科技</span>
						<span>|</span>
						<span><a href="#" th:text="${news.title}" th:href="@{/news/{newsId}(newsId=${news.id})}">蔡老师发明了电灯泡</a></span>
						<span>|</span>
						<span>[[${#dates.format(news.updateTime, 'yyyy-MM-dd')}]]</span>
						<a href="#" class="btn btn-default L_rightbtn" th:href="@{/admin/delnews/{pageNum}/{newsId}(pageNum=${pages.getPageNum()},newsId=${news.id})}">删除</a>
					</div>
				  </li>

				</ul>
				<div class="text-center">
					<nav aria-label="Page navigation">
					  <ul class="pagination" style="font-size:18px;">
						<li>
						  <a href="#" aria-label="Previous" th:if="${pages.isFirstPage != true}" th:href="@{/admin/{pageNum}(pageNum=${pages.getPageNum()-1})}">
							<span aria-hidden="true" >&laquo;上一页</span>
						  </a>
						</li>
						
						<li>
						  <a href="#" aria-label="Next" th:if="${pages.isLastPage != true}" th:href="@{/admin/{pageNum}(pageNum=${pages.getPageNum()+1})}">
							<span aria-hidden="true">下一页&raquo;</span>
						  </a>
						</li>
					  </ul>
					</nav>
				</div>
			</div>
			
			<!--会员管理-->
			<div role="tabpanel" class="tab-pane" id="member-manage">
				<ul class="list-group">
				  <li class="list-group-item" th:each="user : ${users}">
					<div>
						<span th:text="${user.nickname}">蔡老师</span>
						<span>|</span>
						<span>id:[[${user.id}]]</span>
						<span>|</span>
						<span>Email:[[${user.email}]]</span>
						<a class="btn btn-default L_rightbtn" th:href="@{/deluser/{id}(id=${user.id})}">删除</a>
					</div>
				  </li >
				</ul>
			</div>
		</div>

	</div>
	<script src="../../static/jquery/jquery.min.js" th:src="@{/jquery/jquery.min.js}"></script>
    <script src="../../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
  </body>
</html>